package com.xiaoming;

import com.xiaoming.utils.HttpProtocolUtil;

public class LinServlet extends HttpServlet {
    @Override
    public void doGet(Request request, Response response) throws Exception {
         String context = "<H1>Servlet demo2 GET</H1><h2>I'm a demo2</h2>";
         response.output(HttpProtocolUtil.getHttpHeader200(context.getBytes().length) + context);
    }

    @Override
    public void doPost(Request request, Response response) throws Exception {
        String context = "<H1>Servlet demo2 Post</H1><h2>I'm a demo12</h2>";
        response.output(HttpProtocolUtil.getHttpHeader200(context.getBytes().length) + context);
    }

    @Override
    public void init() throws Exception {

    }

    @Override
    public void destory() throws Exception {

    }
}
